package com.xxgc.wujiaoservice;

import com.baomidou.mybatisplus.core.toolkit.AES;

//加密数据库账号密码
public class addMiPass {
    public static void main(String[] args) {
        // 生成16位随机AES密钥
        String rKey = "LtfZsy0123456789";

        String url="jdbc:mysql://47.108.199.209:3306/zde?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=UTC";
        String username="root";
        String password="lf1838Qq.3081";
// 使用随机密钥加密数据
        String encryptedDataUrl = AES.encrypt(url, rKey);
        String encryptedDataUName = AES.encrypt(username, rKey);
        String encryptedDataPassword = AES.encrypt(password, rKey);
        System.out.println("加密后的数据：");
        System.out.println("url = " + encryptedDataUrl);
        System.out.println("username = " + encryptedDataUName);
        System.out.println("password = " + encryptedDataPassword);
    }
}
